﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Main.Master" Inherits="System.Web.Mvc.ViewPage<LiteratureManage.Domain.Models.Literature>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <fieldset style="width:500px;">
        <legend>文献信息：</legend>
        <div style="padding:5px;">
        <%=Html.ClientSideValidation<LiteratureManage.Domain.Models.Literature>() %>
        <% using (Html.BeginForm())
           { %>
        <ul>
            <li>
            文章名称：<%=Html.TextBoxFor(m => m.ArticleName)%>
            <%=Html.ValidationMessageFor(m => m.ArticleName)%>
            </li>
            <li>
            学科类别：<%=Html.TextBoxFor(m => m.SubjectCatalog)%>
            <%=Html.ValidationMessageFor(m => m.SubjectCatalog)%>
            </li>
            <li>
            文章出处：<%=Html.TextBoxFor(m => m.ArticleSource)%>
            <%=Html.ValidationMessageFor(m => m.ArticleSource)%>
            </li>
            <li>
            发表日期：<%if (Model == null)
              { %>
            <%=Html.TextBoxFor(m => m.ArticlePublishDate, new { @class = "date-pick", @readonly = true })%>
            <%}
              else
              { %>
            <%=Html.TextBox("ArticlePublishDate", Model.ArticlePublishDate.ToShortDateString(), new { @class = "date-pick", @readonly = true })%>
            <%} %>
            <%=Html.ValidationMessageFor(m => m.ArticlePublishDate)%>
            </li>
            <li>
            <input type="submit" value="保存信息" />
            </li>
        </ul>
        <%} %>
        </div>
    </fieldset>
    <br />
    <%if (Model != null)
      {
          Html.RenderAction(MVC.Literature.ListAuthors(Model));
    }%>
    
    
    <script type="text/javascript">
        $(function() {
            $("form", document).ajaxForm({
                dataType: "json",
                success: function(data) {
                    alert(data.message);
                    if (data.state == 100) {
                        window.location = data.data.url;
                    }
                }
            });

            $('.fixedAjaxDOMWindow').openDOMWindow({
                height: 220,
                width: 300,
                positionType: 'fixed',
                positionTop: 200,
                positionLeft: 200,
                eventType: 'click',
                loader: 1,
                loaderImagePath: '/Content/Images/ajax-loader.gif',
                loaderHeight: 16,
                loaderWidth: 17,
                windowSource: 'ajax',
                windowHTTPType: 'get'
            });

            $('.date-pick').datepick();
        });
    </script>
</asp:Content>
